#include"processBar.h"  

void download(function<void(int)> func)
{
	int total = 100;
	int cur = 0;
	while (cur<=total)
	{
		std::this_thread::sleep_for(std::chrono::milliseconds(100));
		int rate = cur*100 / total;
		func(rate);
        cur++;
	}
    cout<<endl;
}

int main()
{
	download(my_printf);
	return 0;
}
